<template>
  <div>
    <div class="row">
      <div
        v-show="info.users.length"
        class="card"
        v-for="user in info.users"
        :key="user.login"
      >
        <a :href="user.html_url" target="_blank">
          <img :src="user.avatar_url" style="width: 100px" />
        </a>
        <p class="card-text">{{ user.login }}</p>
      </div>
      <h1 v-show="info.isSearch">请开始搜索</h1>
      <h1 v-show="info.isLogin">搜索中.....</h1>
      <h1 v-show="info.errmsg">{{ info.errmsg }}</h1>
    </div>
  </div>
</template>

<script>
export default {
  name: "List",
  data() {
    return {
      info: {
        isSearch: true,
        isLogin: false,
        errmsg: "",
        users: [],
      },
    };
  },
  mounted() {
    this.$bus.$on("getUsers", (data) => {
        this.info = data
    });
  },
};
</script>

<style lang="css" scoped>
</style>